<?php

namespace Acme\FileManagerBundle\Services;

class PathBuilder
{
    private $m_path;
    private $m_parts = array();
    
    public function __construct($path)
    {
        $this->m_path = $path;
    }
    
    public function getPath()
    {
        return $this->m_path;
    }
    
    public function getParts()
    {
        if (empty($this->m_parts))
        {
            $this->m_parts = \explode('/', \trim($this->m_path, '/'));
        }
        
        return $this->m_parts;
    }
}
